package com.example.hms.controller;

import com.example.hms.entity.Live;
import com.example.hms.entity.Reserve;
import com.example.hms.entity.Stay;
import com.example.hms.service.ReserveService;
import com.example.hms.service.StayService;
import com.example.hms.util.Result;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("reserve")
public class ReserveController {
    @Resource
    private ReserveService reserveService;

    @RequestMapping(value = "selectAllReserve", method = RequestMethod.GET)
    public Result selectAllReserve(Reserve reserve)  {
        return reserveService.selectAllReserve(reserve);
    }

    @RequestMapping(value = "/insert",method = RequestMethod.GET)
    public Result insert(Reserve reserve, HttpServletRequest request)
    {
        return reserveService.insert(reserve,request);
    }
    @RequestMapping(value = "/update",method = RequestMethod.GET)
    public Result update(Reserve reserve, HttpServletRequest request)
        {return reserveService.update(reserve, request);}

    @RequestMapping(value = "/cancelReserve",method = RequestMethod.GET)
    public Result cancelReserve(Reserve reserve, HttpServletRequest request)
    {return reserveService.cancelReserve(reserve, request);}

    @RequestMapping(value = "/abrogateReserve",method = RequestMethod.GET)
    public Result abrogateReserve(Reserve reserve, HttpServletRequest request)
    {return reserveService.abrogateReserve(reserve, request);}

}
